test: improve coverage for hosting implicit SDK initialization#10360
test: improve coverage for hosting implicit SDK initialization#10360
Conversation
### Description Mock dynamic frontend script variable substitution logic for init flows. ### Scenarios Tested - Emulators loading and formatting templates
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new test suite for the hosting/implicitInit module, covering scenarios such as successful configuration fetching, fallback to cached setup on authentication errors, handling of missing configurations, and emulator list population. Feedback was provided to replace the use of the any type in test error handling with a more specific intersection type to adhere to the repository's style guide.
| }); | ||
|
|
||
| it("should fallback to cache if fetch fails with 403", async () => { | ||
| const err: any = new Error("Auth failed"); |
There was a problem hiding this comment.
Avoid using any as an escape hatch, as per the repository style guide (Line 38). You can use a more specific type or an intersection type to define the expected error structure for testing purposes.
| const err: any = new Error("Auth failed"); | |
| const err = new Error("Auth failed") as Error & { context: { response: { statusCode: number } } }; |
References
- Never use
anyorunknownas an escape hatch. Define proper interfaces/types or use type guards. (link)
Description
Mock dynamic frontend script variable substitution logic for init flows.
Scenarios Tested